package com.myk.game.gobangchess.utils;

import com.myk.game.gobangchess.Sign;

import java.util.Collections;
import java.util.List;

public class SignsUtils {
    public static String signs2Str(List<Sign> signList) {
        if (signList == null || signList.isEmpty()) {
            return "-1";
        }
        String info;
        StringBuilder sb = new StringBuilder();
        for (Sign sign : signList) {
            sb.append(sign.getSignInfo()).append(";");
        }
        String s = sb.toString();
        if (s.isEmpty()) {
            info = "-1";
        }
        else {
            info = s.substring(0, s.length() - 1);
        }
        return info;
    }
}
